<?php $emacs=0;

/*
 * Copyright 2006-2009 Jeffrey Palm
 */

/* ==================================================
 * This is the map page. 
 * 
 * To use it copy the following php snippet into 
 * any of your pages -- probably index.php:
 *
 *   define('MAP_KEY',<google map key>)
 *   include 'map.php';
 *
 * If you have questions see Jeff mail.
 *
 * ==================================================
 */

include 'common.php';
include 'geo.php';

$names = array();
getPhotoNames(-1);

for ($i=0, $N=count($names); $i<$N; $i++) {

	$name  = $names[$i];
  $image = $name . '-full.jpg';

  // First check for the existence of geo information
  $geo = new GeoInformation($image);
  if (!$geo->isValid()) continue;
  echo $geo->toString();
  echo "<br/>";

	$des = readFileAll($name . '.des');
	$loc = readFileAll($name . '.loc');
	$date = format_date($name);
	$img = $name . ($theID == -1 ? '' : '-full') . '.jpg';
  $cls = 'smallImage';

  // A hack for now, since I don't have all the large images
  $ncls = $theID == -1 ? 'largeImage' : 'smallImage';
	$nimg = $name . ($theID == -1 ? '-full' : '') . '.jpg';

// 	echo '<tr>';
// 	echo '<td align="left">';
// 	echo '<a name="'.$name.'"></a>';
//   $showLink = $theID == -1 && is_file($nimg) && is_file($img);
// 	if ($showLink) echo '<a href="?'.$name.'" border="0">';
// 	echo '<img class="' . $cls . '" src="' . $img . '" />';
//   if ($showLink) echo '</a>';
// 	echo '</td>';
//   if ($theID != -1) {
//     echo '</tr><tr>';
//   } else {
//     echo '<td>&nbsp;&nbsp;&nbsp;</td>';
//   }
// 	echo '<td align="left" valign="top">';
// 	echo '<b>' . $des . '</b>';
// 	echo '<br/>';
// 	echo $loc;
// 	echo '<br/>';
// 	echo '<em>' . $date . '</em>';
// 	echo '</td>';
// 	echo '</tr>';
//   echo "\n";
 }


?>

<div id="map" style="width:100%; height:93%"></div>